package io.mya.modules.sys.controller;

import io.mya.common.utils.PageUtils;
import io.mya.common.utils.Query;
import io.mya.common.utils.R;
import io.mya.common.validator.ValidatorUtils;
import io.mya.modules.sys.entity.RegisteredrebateEntity;
import io.mya.modules.sys.entity.SysConfigEntity;
import io.mya.modules.sys.service.RegisteredrebateService;
import io.mya.modules.sys.service.SysConfigService;
import io.mya.common.annotation.SysLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import java.util.List;
import java.util.Map;

/**
 * 邀请返利Controller 
 * 
 * @author helin
 * @email 706902861@qq.com
 * @date 2018/03/19 14:55:00
 */
@RestController
@RequestMapping("/sys/registeredrebate")
public class RegisteredrebateController extends AbstractController {
	@Autowired
	private RegisteredrebateService registeredrebateService;
	
	/**
	 * 查询邀请返利表的数据
	 */
	@RequestMapping("/registeredrebatelist")
	@RequiresPermissions("sys:registeredrebate:list")
	public R list(){
		RegisteredrebateEntity queryObject = registeredrebateService.queryObject();
		return R.ok().put("queryObject", queryObject);
	}
	
	
	/**
	 * 
	 * 修改邀请返利设置
	 * 
	 */
	@RequestMapping("/registeredrebateupdateupdate")
//	@RequiresPermissions("sys:registeredrebate:update")
	public R update(RegisteredrebateEntity registeredrebate){
		if(registeredrebate != null){
		registeredrebateService.update(registeredrebate);
		}
		return R.ok();
	}

}
